<template>
	<view class="box" v-for="item,index in content" :key="index" @click="goDetaile(item)">
		<view> {{item.title}}</view>
		<view style="color: #999;font-size: 24rpx;"> {{item.createTime}}</view>
	</view>
</template>

<script>
	import {
		contentList
	} from '@/request/api.js'
	export default {
		data() {
			return {
				content: []
			};
		},
		onShow() {
			this.contentListData()
		},
		methods: {
			goDetaile(e) {
				getApp().globalData.announcement = e
				uni.navigateTo({
					url: '/pages/announcement/Detaile'
				})
			},
			contentListData() {
				contentList().then(res => {
					this.content = res.result.records
					console.log(this.content, '公告');
				})
			},
		}
	}
</script>

<style lang="less">
	.box {
		padding: 20rpx;
		margin: 20rpx;
		border-bottom: 1rpx solid #eee;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
</style>